#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main ()
{
  int res = mkfifo("/tmp/kangness",0777);
  char temp[100];
  int i=0;
  int pipe_fd;
  memset(temp,'\0',100);
  if (res==0 )
  {
    printf("Fifo create error !\n");
    return 1;
  }
  pipe_fd = open("/tmp/my_fifo",O_WRONLY);
  if(pipe_fd <=0)
  {
    printf("open file error \n");
    return 1;
    
    
  }
  strcpy(temp,"kangness\n");
  for(i=0;i<10;i++)
  {
  write(res,temp,sizeof("kangness\n"));
  printf("%s",temp);
  }
  close(pipe_fd);
  return 0;
  
  
}
